﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PBOffice.DAL;
using PBOffice.Models;
namespace PBOffice.BLL
{
    public class NewsManager
    {
        public List<News> GetAllNewsByType(string type)
        {
            return new NewsService().GetAllNewsByType(type);
        }
        public List<News> GetAllNewsByType(string title, string type, int pageIndex, int pageSize)
        {
            return new NewsService().GetAllNewsByType(title, type,pageIndex,pageSize);
        }
        public int GetCountByTitleAndType(string title, string type)
        {
            return new NewsService().GetCountByTitleAndType(title, type);
        }
        public void AddNews(News news)
        {
            new NewsService().AddNews(news);
        }
        public void UpdateNews(News news)
        {
            new NewsService().UpdateNews(news);
        }
        public void DeleteNews(int id)
        {
            new NewsService().DeleteNews(id);
        }
        public News GetNewsById(int newsId)
        {
            return new NewsService().GetNewsById(newsId);
        }
    }
}
